package com.onLineCar.management.template;


/**
 * @author : 段敏强
 * @className : QueryCarLevelAllFeign
 * @description : 描述说明该类的功能
 * @createTime : 2023/12/19 09:42
 */

import com.onLineCar.common.core.domain.Result;
import com.onLineCar.management.domain.VehicleLevel;
import com.onLineCar.management.feign.QueryCarLevelAllData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 车辆类型数据服务
 * @author  段敏强
 */
@Component
public class QueryCarLevelAllFeign {

    @Autowired
    private QueryCarLevelAllData queryCarLevelAllData;


    public List<VehicleLevel> getQueryCarLevelAll(){
        Result<List<VehicleLevel>> listResult = queryCarLevelAllData.queryCarLevelAll();
        if (Result.FAIL == listResult.getCode()){
            throw new RuntimeException("feign调用失败");
        }
        return listResult.getData();
    }

}
